package ch.zbw.sysventory.server.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import ch.zbw.sysventory.server.model.NetworkAdapter;
import ch.zbw.sysventory.server.repository.NetworkAdapterRepository;
import ch.zbw.sysventory.server.service.NetworkAdapterService;

@Service
public class NetworkAdapterServiceImpl implements NetworkAdapterService {

	@Autowired
	private NetworkAdapterRepository networkAdapterRepository;

	@Override
	public NetworkAdapter get(Long id) {
		return this.networkAdapterRepository.findOne(id);
	}

	@Override
	public List<NetworkAdapter> list() {
		return this.networkAdapterRepository.findAll();
	}

	@Override
	public NetworkAdapter save(NetworkAdapter networkAdapter) {
		return this.networkAdapterRepository.saveAndFlush(networkAdapter);
	}

	@Override
	public NetworkAdapter update(NetworkAdapter networkAdapter) {
		return this.networkAdapterRepository.saveAndFlush(networkAdapter);
	}

}
